{% block sw_mail_template_list_grid %}
<mt-card
    :title="$tc('sw-mail-template.list.titleMailTemplateList')"
    position-identifier="sw-mail-template-list"
>

    {% block sw_mail_template_list_grid_empty_state %}
    <sw-empty-state
        v-if="!isLoading && !showListing"
        :title="$tc('sw-mail-template.list.emptyStateTitle')"
        :subline="$tc('sw-mail-template.list.emptyStateSubTitle')"
        :absolute="false"
    >

        {% block sw_mail_template_list_grid_empty_state_icon %}
        <template #icon>
            <img
                :src="assetFilter('/administration/administration/static/img/empty-states/settings-empty-state.svg')"
                alt=""
            >
        </template>
        {% endblock %}

    </sw-empty-state>
    {% endblock %}

    <template #grid>
        <sw-entity-listing
            v-if="isLoading || showListing"
            id="mailTemplateGrid"
            class="sw-mail-templates-list-grid"
            detail-route="sw.mail.template.detail"
            identifier="sw-mail-template-list"
            :items="mailTemplates"
            :columns="getListColumns()"
            :repository="mailTemplateRepository"
            :full-page="false"
            :is-loading="isLoading"
            :allow-view="acl.can('mail_templates.viewer')"
            :allow-edit="acl.can('mail_templates.editor')"
            :allow-delete="acl.can('mail_templates.deleter')"
            :show-selection="acl.can('mail_templates.deleter') || undefined"
            :skeleton-item-amount="skeletonItemAmount"
            @update-records="updateRecords"
        >
            {% block sw_mail_template_list_grid_columns %}
            {% endblock %}

            {% block sw_mail_template_list_grid_actions %}
            <template #more-actions="{ item }">
                {% block sw_mail_template_list_grid_columns_actions_duplicate %}
                <sw-context-menu-item
                    class="sw-mail-template-list-grid__duplicate-action"
                    :disabled="!acl.can('mail_templates.creator') || undefined"
                    @click="onDuplicate(item.id)"
                >
                    {{ $tc('sw-mail-template.list.contextMenuDuplicate') }}
                </sw-context-menu-item>
                {% endblock %}
            </template>
            {% endblock %}
        </sw-entity-listing>
    </template>
</mt-card>
{% endblock %}
